<%-- 
    Document   : RealizarReservas
    Created on : 16/06/2010, 12:16:17 PM
    Author     : DUOTRABAJO
--%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.util.*"%>
<%@ page import="pe.edu.upc.dew.profesoresparticulares.model.Usuario"%>
<%@ page import="pe.edu.upc.dew.profesoresparticulares.service.UsuarioServiceImpl"%>
<%@ page import="pe.edu.upc.dew.profesoresparticulares.model.Horario"%>

<%List<Map> menus = (List<Map>) request.getSession().getAttribute("MENU");%>
<%ArrayList<Horario> horarioDisponible = (ArrayList<Horario>) request.getAttribute("horariosDisponibles");%>
<%UsuarioServiceImpl objUsusarioImpl = new UsuarioServiceImpl();%>
<%List<Usuario> profesores = (List<Usuario>) objUsusarioImpl.getUsuarioProfesores();%>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Bienvenido | Profesores Particulares</title>
        <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
        <meta name="author" content="fullahead.org" />
        <meta name="keywords" content="XHTML, CSS, template, FullAhead" />
        <meta name="description" content="A valid, XHTML 1.0 template" />
        <meta name="robots" content="index, follow, noarchive" />
        <meta name="googlebot" content="noarchive" />

        <link rel="stylesheet" type="text/css" href="css/html.css" media="screen, projection, tv " />
        <link rel="stylesheet" type="text/css" href="css/layout.css" media="screen, projection, tv" />
        <link rel="stylesheet" type="text/css" href="css/print.css" media="print" />


    </head>

    <body>
        <!-- #wrapper: centers the content and sets the width -->
        <div id="wrapper">
            <!-- #content: applies the white, dropshadow background -->
            <div id="content">
                <div id="header">
                    <h1><span class="big darkBrown">P</span>rofesores <span class="big darkBrown">P</span>articulares</h1>
                    <h2><span class="highlight">Reserva tu curso y profesor favorito en un par de clicks.</span></h2>
                </div>

                <ul id="menu" class="six">
                    <%for (int i = 0; i < menus.size(); i++) {%>
                    <li><a href="<%=request.getContextPath()%>/<%=((Map) menus.get(i)).get("url")%>" title="" class="here">
                            <span class="big"></span>
                            <%=((Map) menus.get(i)).get("descripcion")%>
                        </a></li>

                    <% }%>
                </ul>
                <!-- #page: holds all page content, as well as footer -->
                <div id="page">
                    <s:form action="buscarHorarioDisponibleProfesor">
                                    <s:select list="profesoresList" label="Profesor" name="profesor" listKey="codUsuario" listValue="nomUsuario"></s:select>

                                Horario:
                                Dia
                                            <select name="dia">
                                                    <option value="00"> </option>
                                                    <option value="01">1</option>
                                                    <option value="02">2</option>
                                                    <option value="03">3</option>
                                                    <option value="04">4</option>
                                                    <option value="05">5</option>
                                                    <option value="06">6</option>
                                                    <option value="07">7</option>
                                                    <option value="08">8</option>
                                                    <option value="09">9</option>
                                                    <option value="10">10</option>
                                                    <option value="11">11</option>
                                                    <option value="12">12</option>
                                                    <option value="13">13</option>
                                                    <option value="14">14</option>
                                                    <option value="15">15</option>
                                                    <option value="16">16</option>
                                                    <option value="17">17</option>
                                                    <option value="18">18</option>
                                                    <option value="19">19</option>
                                                    <option value="20">20</option>
                                                    <option value="21">21</option>
                                                    <option value="22">22</option>
                                                    <option value="23">23</option>
                                                    <option value="24">24</option>
                                                    <option value="25">25</option>
                                                    <option value="26">26</option>
                                                    <option value="27">27</option>
                                                    <option value="28">28</option>
                                                    <option value="29">29</option>
                                                    <option value="30">30</option>
                                                    <option value="31">31</option>
                                                </select>
                                Mes
                                                <select name="mes">
                                                    <option value="01">Enero</option>
                                                    <option value="02">Febrero</option>
                                                    <option value="03">Marzo</option>
                                                    <option value="04">Abril</option>
                                                    <option value="05">Mayo</option>
                                                    <option value="06">Junio</option>
                                                    <option value="07">Julio</option>
                                                    <option value="08">Agosto</option>
                                                    <option value="09">Septiembre</option>
                                                    <option value="10">Octubre</option>
                                                    <option value="11">Noviembre</option>
                                                    <option value="12">Diciembre</option>
                                                </select>
                                Año:
                                                <select name="anho">
                                                    <option value="2010">2010</option>
                                                    <option value="2011">2011</option>
                                                    <option value="2013">2012</option>
                                                </select>
                                <s:submit name="Submit" value="Buscar" />
                                    

                            </s:form>

                            <%if (horarioDisponible != null && horarioDisponible.size() > 0) {%>
                            <s:form action="reservaHorarioDisponible">
                            <table width="500" border="1" align="center">

                                <tr>
                                    <td><strong>Codigo Horario</strong></td>
                                    <td><strong>Fecha</strong></td>
                                    <td><strong>Hora</strong></td>
                                    <td><strong>Lugar</strong></td>
                                    <td><strong>Alumno</strong></td>
                                </tr>

                                <%for (Horario h : horarioDisponible) {
                               /* String color = "";
                                if (h.getNomAlumno().equals("")) {
                                    color = "#FFFFFF";
                                } else {
                                    color = "#00FFFF";
                                }*/
                                %>

                                <tr bgcolor="#FFFFFF">
                                    <td> <%=h.getCodHorario()%></td>
                                    <td><%=h.getFecha()%></td>
                                    <td><%=h.getDescHora()%></td>
                                    <td><%=h.getLugar()%></td>
                                    <td><input type="radio" name="codHorarioReserva" value= <%=h.getCodHorario()%> /></td>
                                </tr>
                             <% }%>
                            </table>
                            
                           <s:submit name="Reservar" value="Reservar" />
                            
                            </s:form>
                        <%}%>
                        </tr>

                    </table>
                    <p class="footer">
                        Design by <a href="http://fullahead.org" title="Visit FullAhead">FullAhead</a>.  Valid CSS &amp; XHTML with no rights reserved.
                    </p>

                </div>

            </div>

        </div>

    </body>

</html>